/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 80018
 Source Host           : localhost
 Source Database       : AnJiaMallServer

 Target Server Type    : MySQL
 Target Server Version : 80018
 File Encoding         : utf-8

 Date: 04/08/2020 16:06:11 PM
*/

SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
--  Table structure for `an_jia_access`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_access`;
CREATE TABLE `an_jia_access` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `uuid` varchar(50) NOT NULL COMMENT 'uuid主键',
  `module_name` varchar(50) DEFAULT NULL COMMENT '模块名字',
  `type` enum('1','2','3') DEFAULT NULL COMMENT '节点类型:1、表示模块顶级模块 2、表示菜单 3、操作',
  `action_name` varchar(100) DEFAULT NULL COMMENT '操作名称',
  `icon` varchar(100) DEFAULT NULL COMMENT '菜单图标',
  `url` varchar(100) DEFAULT NULL COMMENT '跳转路径',
  `method` varchar(10) DEFAULT NULL COMMENT '请求方式',
  `module_id` int(11) NOT NULL DEFAULT '-1' COMMENT '自关联的父节点id',
  `platform` varchar(50) DEFAULT NULL COMMENT '平台',
  `sort` int(11) NOT NULL DEFAULT '1' COMMENT '排序',
  `description` varchar(100) DEFAULT NULL COMMENT '描素',
  `status` tinyint(4) DEFAULT '1' COMMENT '状态',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `module_name` (`module_name`),
  UNIQUE KEY `action_name` (`action_name`)
) ENGINE=InnoDB AUTO_INCREMENT=18 DEFAULT CHARSET=utf8 COMMENT='资源表';

-- ----------------------------
--  Records of `an_jia_access`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_access` VALUES ('2', 'bc5e0b76-6871-4b40-a07a-b95cf6318a08', '系统管理', '1', null, 'team', null, null, '-1', null, '4', null, '1', '2020-01-28 10:04:03', '2020-01-29 15:33:55'), ('3', 'b5fbbe9b-fc24-4837-af48-026f0394ca1a', null, '2', '用户中心', 'user', '/system/user', null, '2', null, '3', null, '1', '2020-01-28 10:04:30', '2020-01-28 11:02:02'), ('4', '7af475d5-c215-409b-9617-8fe516082653', null, '2', '角色管理', 'usergroup-add', '/system/role', null, '2', null, '4', null, '1', '2020-01-28 10:04:58', '2020-01-28 11:01:44'), ('5', 'f1ba8f92-185a-4621-b5e1-280b27064b26', null, '2', '资源管理', 'apartment', '/system/access', null, '2', null, '5', null, '1', '2020-01-28 10:05:22', '2020-01-28 11:05:41'), ('6', '8d4aff5b-73c9-4aa5-8f93-d815807d9d6f', '设置', '1', null, 'setting', '/setting', null, '-1', null, '15', null, '1', '2020-01-28 10:05:41', '2020-01-28 11:13:30'), ('7', 'c8ecbb49-f5ab-4b70-a5d4-542618498049', null, '3', '添加用户', null, '/api/v1/admin/user', 'POST', '3', null, '1', '添加数据', '1', '2020-01-28 10:12:30', '2020-01-28 14:42:39'), ('8', '3dc17ec1-dd6a-4f3a-9d06-5c6a0c19df85', null, '3', '删除用户', null, '/api/v1/admin/user', 'DELETE', '3', null, '1', null, '1', '2020-01-28 10:13:25', '2020-01-28 14:39:14'), ('9', '04b57a7f-e9bc-443b-b2a0-0e7673fbea30', null, '3', '修改用户', null, '/api/v1/admin/user', 'PATH', '3', null, '10', null, '1', '2020-01-28 10:13:54', '2020-01-28 14:39:29'), ('10', '7ed89e42-034a-4cba-93e0-f969ded8d0db', '文件中心', '1', null, 'file', '/file', null, '-1', null, '1', null, '1', '2020-01-28 10:24:35', '2020-01-29 14:58:41'), ('11', 'a39b968b-71c4-41ee-8fe0-31bbc17eff39', null, '3', '用户列表', null, '/api/v1/admin/user', 'GET', '3', null, '1', null, '1', '2020-01-28 14:38:18', '2020-01-28 14:38:18'), ('12', '7d9feaf6-e1db-431b-896d-607170606879', '商品管理', '1', null, 'shopping', null, null, '-1', null, '3', null, '1', '2020-01-29 15:21:24', '2020-01-29 15:28:40'), ('13', '8b631ce6-6685-491a-984a-5d7cd76db31f', null, '2', '商品分类', 'control', '/goods/category', null, '12', null, '2', null, '1', '2020-01-29 15:22:06', '2020-01-29 15:29:22'), ('14', 'e6762f6a-0351-40c9-b853-fddedbd61aa1', null, '2', '商品列表', 'ordered-list', '/goods', null, '12', null, '1', null, '1', '2020-01-29 15:22:45', '2020-01-29 15:30:04'), ('15', '9075eaa6-ec46-4d25-8447-0e854c62b204', null, '3', '添加角色', null, '/api/v1/admin/role', 'POST', '4', null, '1', null, '1', '2020-01-29 21:47:06', '2020-01-29 21:47:30'), ('16', 'fd79f3b5-02c6-4b0c-902d-4bf465b063bb', null, '2', '添加商品', 'border-inner', '/goods/add', null, '12', null, '3', null, '1', '2020-01-30 15:30:39', '2020-01-30 15:30:39'), ('17', 'e14c2366-f749-42ad-b041-d883f98c85e3', null, '2', '订单管理', 'account-book', '/goods/order', null, '12', null, '4', null, '1', '2020-01-30 15:33:30', '2020-01-30 15:33:30');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_ad`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_ad`;
CREATE TABLE `an_jia_ad` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `ad_position_id` int(5) NOT NULL DEFAULT '0' COMMENT '关联到广告位置id',
  `media_type` tinyint(3) NOT NULL DEFAULT '0' COMMENT '类型',
  `name` varchar(60) NOT NULL DEFAULT '' COMMENT '广告名称',
  `link` varchar(255) NOT NULL DEFAULT '' COMMENT '链接地址',
  `image_url` text NOT NULL COMMENT '图片地址',
  `content` varchar(255) NOT NULL DEFAULT '' COMMENT '内容',
  `start_time` varchar(13) DEFAULT '' COMMENT '上架时间鹾',
  `end_time` varchar(13) DEFAULT '' COMMENT '下架时间鹾',
  `status` tinyint(4) DEFAULT '1' COMMENT '状态',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='广告表';

-- ----------------------------
--  Table structure for `an_jia_ad_position`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_ad_position`;
CREATE TABLE `an_jia_ad_position` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `name` varchar(60) NOT NULL DEFAULT '' COMMENT '名称',
  `width` int(5) NOT NULL DEFAULT '100' COMMENT '宽度',
  `height` int(5) NOT NULL DEFAULT '100' COMMENT '高度',
  `desc` varchar(255) NOT NULL DEFAULT '' COMMENT '描素',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='广告位置';

-- ----------------------------
--  Records of `an_jia_ad_position`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_ad_position` VALUES ('1', '测试', '100', '100', '简单一句', '2020-02-19 15:57:02', '2020-02-19 15:57:02');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_address`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_address`;
CREATE TABLE `an_jia_address` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `name` varchar(50) NOT NULL DEFAULT '' COMMENT '名称',
  `user_id` mediumint(8) NOT NULL DEFAULT '0' COMMENT '关联到客户端用户id',
  `district_id` int(11) NOT NULL DEFAULT '0' COMMENT '地址关联到开放的小区',
  `describe` varchar(120) NOT NULL DEFAULT '' COMMENT '具体地址',
  `mobile` varchar(11) NOT NULL DEFAULT '' COMMENT '手机号码',
  `location` varchar(100) DEFAULT '' COMMENT '经纬度',
  `address` varchar(100) DEFAULT '' COMMENT '定位地址',
  `is_default` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否为默认地址',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='收货地址表';

-- ----------------------------
--  Records of `an_jia_address`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_address` VALUES ('1', '张三', '1', '1', '西头', '110', '', '', '0', '2020-04-05 09:27:10', '2020-04-05 09:27:10');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_attribute`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_attribute`;
CREATE TABLE `an_jia_attribute` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `title` varchar(60) NOT NULL COMMENT '属性名称',
  `attr_key` int(11) NOT NULL COMMENT '属性id,是单行文本框、多行文本框、下拉框',
  `attr_values` varchar(250) DEFAULT NULL COMMENT '属性值，只有下拉框才有的，宜换行表示',
  `status` tinyint(4) DEFAULT '1' COMMENT '状态',
  `attribute_type_id` int(11) DEFAULT NULL COMMENT '关联到商品属性类型id',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='商品属性';

-- ----------------------------
--  Records of `an_jia_attribute`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_attribute` VALUES ('1', '500g', '0', null, '0', '2', '2020-02-18 20:45:00', '2020-02-18 20:45:00');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_attribute_type`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_attribute_type`;
CREATE TABLE `an_jia_attribute_type` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `name` varchar(60) NOT NULL COMMENT '类型名称',
  `description` varchar(255) DEFAULT NULL COMMENT '类型介绍',
  `status` tinyint(4) DEFAULT '1' COMMENT '状态',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='商品属性类型';

-- ----------------------------
--  Records of `an_jia_attribute_type`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_attribute_type` VALUES ('1', '规格', '方的', '0', '2020-02-18 20:42:07', '2020-02-18 20:42:07'), ('2', '包装', null, '0', '2020-02-18 20:42:55', '2020-02-18 20:42:55');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_brand`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_brand`;
CREATE TABLE `an_jia_brand` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `name` varchar(255) NOT NULL COMMENT '品牌名称',
  `brand_image` varchar(255) DEFAULT NULL COMMENT '品牌logo',
  `desc` varchar(255) DEFAULT NULL COMMENT '描述',
  `sort` tinyint(3) NOT NULL DEFAULT '50' COMMENT '排序',
  `status` tinyint(4) DEFAULT '1' COMMENT '状态',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='商品品牌';

-- ----------------------------
--  Records of `an_jia_brand`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_brand` VALUES ('1', '苹果', '1.png', null, '50', '1', '2020-03-13 11:01:50', '2020-03-13 11:01:50'), ('2', '小米', '2.png', null, '50', '1', '2020-03-13 11:01:50', '2020-03-13 11:01:50'), ('3', '华为', '3.png', null, '50', '1', '2020-03-13 11:01:50', '2020-03-13 11:01:50'), ('4', 'op', '4.png', null, '50', '1', '2020-03-13 11:01:50', '2020-03-13 11:01:50'), ('5', 'vo', '5.png', null, '50', '1', '2020-03-13 11:01:50', '2020-03-13 11:01:50');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_cancel_order_reason`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_cancel_order_reason`;
CREATE TABLE `an_jia_cancel_order_reason` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `reason` varchar(200) DEFAULT '' COMMENT '申请取消原因',
  `is_del` tinyint(4) DEFAULT '1' COMMENT '是否删除,0表示删除,1表示未删除',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='还未支付的时候取消订单原因';

-- ----------------------------
--  Table structure for `an_jia_cart`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_cart`;
CREATE TABLE `an_jia_cart` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `user_id` mediumint(8) NOT NULL DEFAULT '0' COMMENT '用户id',
  `goods_id` mediumint(8) NOT NULL DEFAULT '0' COMMENT '商品id',
  `is_select` tinyint(4) DEFAULT '0' COMMENT '是否选中',
  `market_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '市场价格(原价)',
  `shop_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '价格(现销售价格)',
  `number` int(11) NOT NULL DEFAULT '0' COMMENT '数量',
  `attribute` varchar(250) DEFAULT NULL COMMENT '商品可选属性',
  `goods_sku` varchar(500) DEFAULT NULL COMMENT '商品销售属性',
  `remark` varchar(250) DEFAULT NULL COMMENT '备注信息',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='购物车';

-- ----------------------------
--  Records of `an_jia_cart`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_cart` VALUES ('2', '1', '3', '0', '10.00', '10.00', '1', null, '', null, '2020-03-13 17:51:38', '2020-03-13 17:54:57'), ('3', '1', '4', '0', '10.00', '10.00', '1', null, '', null, '2020-03-13 17:55:48', '2020-03-13 17:55:48');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_category`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_category`;
CREATE TABLE `an_jia_category` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `title` varchar(90) NOT NULL COMMENT '分类名称',
  `cate_image` varchar(100) DEFAULT NULL COMMENT '分类图标',
  `link` varchar(100) DEFAULT NULL COMMENT '分类跳转地址',
  `template` varchar(100) DEFAULT NULL COMMENT '分类模板',
  `parent_id` int(11) NOT NULL DEFAULT '-1' COMMENT '自关联id',
  `sort` tinyint(3) NOT NULL DEFAULT '50' COMMENT '排序',
  `status` tinyint(4) DEFAULT '1' COMMENT '状态',
  `keywords` varchar(100) DEFAULT NULL COMMENT '关键词',
  `description` varchar(250) DEFAULT NULL COMMENT '描素',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COMMENT='商品分类';

-- ----------------------------
--  Records of `an_jia_category`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_category` VALUES ('1', '水果', 'aa.png', 'baidu.com', null, '-1', '1', '1', null, null, '2020-03-04 14:34:11', '2020-03-04 14:34:11'), ('2', '生鲜', 'bb.png', 'baidu.con', null, '-1', '1', '1', null, null, '2020-03-04 14:34:36', '2020-03-05 14:10:23'), ('3', '苹果', 'aa.png', 'baidu.com', null, '1', '1', '1', null, null, '2020-03-05 14:10:47', '2020-03-05 14:10:47'), ('4', '西瓜', 'aa.png', null, null, '1', '50', '1', null, null, '2020-03-05 14:11:08', '2020-03-05 14:11:08'), ('5', '牛肉', null, null, null, '2', '50', '1', null, null, '2020-03-05 14:11:23', '2020-03-05 14:11:23'), ('6', '猪肉', null, null, null, '2', '50', '1', null, null, '2020-03-05 14:11:35', '2020-03-05 14:11:35'), ('7', '坚果', null, null, null, '-1', '50', '1', null, null, '2020-03-13 10:45:16', '2020-03-13 10:45:16'), ('8', '麦片', null, null, null, '-1', '50', '1', null, null, '2020-03-13 10:45:16', '2020-03-13 10:45:16'), ('9', '糖果', null, null, null, '-1', '50', '1', null, null, '2020-03-13 10:45:16', '2020-03-13 10:45:16');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_collect`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_collect`;
CREATE TABLE `an_jia_collect` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `user_id` int(11) NOT NULL DEFAULT '0',
  `goods_id` int(11) NOT NULL DEFAULT '0',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='用户收藏';

-- ----------------------------
--  Records of `an_jia_collect`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_collect` VALUES ('1', '1', '1', '2020-04-03 13:54:24', '2020-04-03 13:54:24'), ('2', '1', '1', '2020-04-03 14:00:39', '2020-04-03 14:00:39');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_deliverer_on_duty_time`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_deliverer_on_duty_time`;
CREATE TABLE `an_jia_deliverer_on_duty_time` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '关联到用户表id',
  `start_time` timestamp NULL DEFAULT NULL COMMENT '上班时间',
  `end_time` timestamp NULL DEFAULT NULL COMMENT '下班时间',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='派送员上班考勤';

-- ----------------------------
--  Records of `an_jia_deliverer_on_duty_time`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_deliverer_on_duty_time` VALUES ('1', '1', '2020-04-05 17:03:28', '2020-04-05 21:51:33', '2020-04-05 17:03:27', '2020-04-05 21:51:36'), ('2', '7', '2020-04-05 17:35:06', '2020-04-05 21:51:37', '2020-04-05 17:35:10', '2020-04-05 21:51:40'), ('3', '8', '2020-04-05 18:49:33', null, '2020-04-05 18:49:36', '2020-04-05 18:49:36');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_deliverer_order`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_deliverer_order`;
CREATE TABLE `an_jia_deliverer_order` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `user_id` int(11) NOT NULL DEFAULT '0' COMMENT '关联到用户表id',
  `order_id` int(11) NOT NULL DEFAULT '0' COMMENT '订单id',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8 COMMENT='派送员与订单的关系';

-- ----------------------------
--  Records of `an_jia_deliverer_order`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_deliverer_order` VALUES ('1', '1', '4', '2020-04-05 17:18:31', '2020-04-05 17:18:31'), ('10', '1', '5', '2020-04-05 17:51:18', '2020-04-05 17:51:18'), ('16', '7', '5', '2020-04-05 18:48:15', '2020-04-05 18:48:15'), ('17', '8', '5', '2020-04-05 18:49:41', '2020-04-05 18:49:41'), ('20', '7', '5', '2020-04-05 21:49:10', '2020-04-05 21:49:10'), ('21', '8', '5', '2020-04-05 21:50:45', '2020-04-05 21:50:45'), ('22', '8', '5', '2020-04-05 21:52:37', '2020-04-05 21:52:37'), ('23', '8', '5', '2020-04-05 21:55:34', '2020-04-05 21:55:34'), ('24', '8', '5', '2020-04-05 21:56:23', '2020-04-05 21:56:23');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_dist_config`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_dist_config`;
CREATE TABLE `an_jia_dist_config` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `key` int(11) NOT NULL DEFAULT '0' COMMENT 'key值',
  `value` varchar(50) NOT NULL DEFAULT '' COMMENT 'value值',
  `category` varchar(50) NOT NULL DEFAULT '' COMMENT '分类',
  `description` varchar(100) DEFAULT NULL COMMENT '描述',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=8 DEFAULT CHARSET=utf8 COMMENT='数据字典表';

-- ----------------------------
--  Records of `an_jia_dist_config`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_dist_config` VALUES ('2', '0', '个人中心', 'user', null, '2020-02-15 19:42:00', '2020-02-15 19:42:00'), ('3', '0', '单行文本框', 'attribute_type', null, '2020-02-18 08:55:29', '2020-02-18 08:55:29'), ('4', '1', '多行文本框', 'attribute_type', null, '2020-02-18 08:55:49', '2020-02-18 08:55:49'), ('5', '2', '从下面的列表中选择(一行代表一个可选值)', 'attribute_type', '以换行表示一个下拉框的值', '2020-02-18 08:56:29', '2020-02-18 08:58:01'), ('6', '0', '斤', 'goods_unit', '计量单位', '2020-02-18 20:49:34', '2020-02-18 20:49:34'), ('7', '0', '斤', 'goods_unit', '计量单位', '2020-02-18 21:04:52', '2020-02-18 21:04:52');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_district`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_district`;
CREATE TABLE `an_jia_district` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `name` varchar(100) NOT NULL COMMENT '小区名',
  `address` varchar(100) DEFAULT '' COMMENT '具体地址',
  `is_del` tinyint(4) DEFAULT '1' COMMENT '是否删除,0表示删除，1表示没删除',
  `site_ids` varchar(20) NOT NULL DEFAULT '' COMMENT '小区关联到站点id,多个的时候用，拼接',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='开放的小区';

-- ----------------------------
--  Records of `an_jia_district`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_district` VALUES ('1', '小区一', '地址一', '1', '1,2', '2020-04-05 09:01:45', '2020-04-05 09:01:54');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_footprint`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_footprint`;
CREATE TABLE `an_jia_footprint` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `user_id` int(11) NOT NULL DEFAULT '0',
  `goods_id` int(11) NOT NULL DEFAULT '0',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='用户足迹';

-- ----------------------------
--  Records of `an_jia_footprint`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_footprint` VALUES ('1', '1', '0', '2020-04-03 14:07:42', '2020-04-03 14:07:42'), ('2', '1', '0', '2020-04-03 14:10:56', '2020-04-03 14:10:56'), ('3', '1', '1', '2020-04-03 14:16:33', '2020-04-03 14:16:33');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_front_user`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_front_user`;
CREATE TABLE `an_jia_front_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `uuid` varchar(50) NOT NULL COMMENT 'uuid主键',
  `username` varchar(50) DEFAULT '' COMMENT '用户名',
  `password` varchar(100) DEFAULT NULL COMMENT '用户密码',
  `mobile` varchar(50) DEFAULT '' COMMENT '用户手机号码',
  `email` varchar(50) DEFAULT '' COMMENT '用户邮箱',
  `avatar` varchar(255) DEFAULT '' COMMENT '头像地址',
  `birthday` timestamp NULL DEFAULT NULL COMMENT '生日',
  `gender` tinyint(4) DEFAULT '0' COMMENT '性别:0表示女,1表示男',
  `is_marriage` tinyint(4) DEFAULT '0' COMMENT '是否婚否:0表示未婚,1表示已婚',
  `integral` int(11) DEFAULT '0' COMMENT '积分',
  `grade` int(11) DEFAULT NULL COMMENT '会员等级',
  `status` tinyint(4) DEFAULT '1' COMMENT '用户状态',
  `remark` varchar(200) DEFAULT NULL COMMENT '备注信息',
  `device_id` varchar(100) DEFAULT NULL COMMENT '针对移动端设备id',
  `last_login_ip` varchar(60) DEFAULT '' COMMENT '最后登录ip',
  `last_login_method` varchar(100) NOT NULL DEFAULT 'password' COMMENT '最后一次登录方式',
  `last_login_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '最后登录时间',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`),
  UNIQUE KEY `mobile` (`mobile`),
  UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='前端用户表';

-- ----------------------------
--  Records of `an_jia_front_user`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_front_user` VALUES ('1', '90c7245e-6229-46dd-91f3-05b3f6c2ed52', 'admin', 'MU56S2NGcWk2Vg==ZTM5YTkzZjgwN2MzNjhkOTQzMWRlNzcxZThjMTgyMGI=', '60e61445-d010-41a3-b2f0-6042c9643f27', '44bc0ff7-74f1-4445-9858-9be501affb45', '', null, '0', '0', '0', null, '1', null, null, '::1', 'password', '2020-04-04 14:30:01', '2020-02-22 12:11:43', '2020-04-04 14:30:00');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_goods`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_goods`;
CREATE TABLE `an_jia_goods` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `title` varchar(100) NOT NULL COMMENT '商品名称',
  `sub_title` varchar(100) DEFAULT '' COMMENT '二级标题',
  `goods_sn` varchar(60) DEFAULT '' COMMENT '商品条形码',
  `category_id` int(11) NOT NULL DEFAULT '0' COMMENT '商品分类',
  `brand_id` int(11) NOT NULL DEFAULT '0' COMMENT '品牌id',
  `click_count` int(11) NOT NULL DEFAULT '0' COMMENT '点击数',
  `goods_number` int(11) NOT NULL DEFAULT '0' COMMENT '商品数量',
  `goods_unit` varchar(45) DEFAULT '' COMMENT '商品单位',
  `primary_pic_url` varchar(255) NOT NULL DEFAULT '' COMMENT '商品主图',
  `shop_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '零售价格(打折后的价格)',
  `market_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '单位价格，单价，原价',
  `keywords` varchar(255) NOT NULL DEFAULT '' COMMENT '关键词',
  `status` tinyint(4) DEFAULT '1' COMMENT '状态1表示上线，0表示下线, -1表示删除',
  `is_on_sale` tinyint(3) NOT NULL DEFAULT '0' COMMENT '是否打折,0表示不打折,1表示打折',
  `sort` int(11) NOT NULL DEFAULT '0' COMMENT '排序',
  `content` text COMMENT '商品详情',
  `is_del` tinyint(4) DEFAULT '1' COMMENT '是否删除,0表示删除,1表示未删除',
  `is_new` tinyint(3) NOT NULL DEFAULT '0' COMMENT '是否新品',
  `sell_volume` int(11) NOT NULL DEFAULT '0' COMMENT '销售量',
  `limited` tinyint(3) NOT NULL DEFAULT '100' COMMENT '限售数量',
  `is_hot` tinyint(3) NOT NULL DEFAULT '0' COMMENT '是否热销,0表示不是热销，1表示热销',
  `is_home` tinyint(4) DEFAULT '0' COMMENT '是否推荐到首页,0表示不推荐,1表示推荐',
  `goods_type_attribute_id` int(11) DEFAULT '0' COMMENT '关联商品类型id',
  `sku_type_id` int(11) DEFAULT '0' COMMENT '商品销售属性的id',
  `skus_json` varchar(500) DEFAULT '' COMMENT '商品销售属性json字符串',
  `last_buy_price` decimal(10,2) DEFAULT '0.00' COMMENT '最近采购价格',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COMMENT='商品表';

-- ----------------------------
--  Records of `an_jia_goods`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_goods` VALUES ('1', '野生111111黄牛肉', '牛111肉', '1585374152671470', '1', '1', '0', '0', '1', '1.png', '10.00', '30.00', '', '1', '1', '0', '好吃的牛肉', '1', '1', '1', '10', '0', '0', '0', '0', '[{\"颜色\":[\"红色\",\"黄色\"]},{\"大小\":[\"100近\",\"20近\"]}]', '0.00', '2020-03-28 13:42:32', '2020-04-04 15:56:08'), ('2', '野生椒牛肉面', '牛肉', '1585374325156779', '1', '1', '0', '0', '1', '1.png', '30.00', '30.00', '', '1', '1', '0', '好吃的牛肉', '1', '1', '1', '10', '0', '0', '0', '0', '', '1.00', '2020-03-28 13:45:25', '2020-04-04 15:56:05'), ('3', '野生111111222黄牛肉', '牛2222肉', '1585374351353210', '1', '1', '0', '0', '1', '1.png', '10.00', '30.00', '', '1', '1', '0', '好吃的牛肉', '1', '1', '1', '10', '0', '0', '0', '0', '[{\"颜色\":[\"红色\",\"黄色\"]},{\"大小\":[\"100近\",\"20近\"]}]', '1.00', '2020-03-28 13:45:51', '2020-04-04 15:56:11'), ('8', '野生333黄牛肉', '牛333肉', '1585374965974822', '1', '1', '0', '0', '1', '1.png', '10.00', '30.00', '', '1', '1', '0', '好吃的牛肉', '1', '1', '1', '10', '0', '0', '0', '0', '', '1.00', '2020-03-28 13:56:06', '2020-04-04 15:56:15'), ('9', '苹果手机', '苹果9', '1585807713009242', '1', '1', '0', '0', '1', '1.png', '1.00', '10.00', '手机', '1', '1', '0', '苹果新款手机', '1', '1', '0', '1', '0', '0', '1', '0', '[{\"颜色\":[\"红色\",\"黄色\"]}]', '1.00', '2020-04-02 14:08:33', '2020-04-04 13:33:03');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_goods_attribute`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_goods_attribute`;
CREATE TABLE `an_jia_goods_attribute` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `title` varchar(100) DEFAULT NULL COMMENT 'titile值',
  `value` varchar(250) DEFAULT NULL COMMENT 'value值',
  `attr_key` int(11) DEFAULT '0' COMMENT '属性的值',
  `goods_id` int(11) DEFAULT NULL COMMENT '关联商品的id',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商品属性表';

-- ----------------------------
--  Table structure for `an_jia_goods_relation`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_goods_relation`;
CREATE TABLE `an_jia_goods_relation` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `goods_id` int(11) DEFAULT NULL COMMENT '商品id',
  `relation_goods_id` int(11) DEFAULT NULL COMMENT '关联商品id',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='关联商品';

-- ----------------------------
--  Table structure for `an_jia_goods_sku`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_goods_sku`;
CREATE TABLE `an_jia_goods_sku` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `goods_id` int(11) NOT NULL DEFAULT '0' COMMENT '关联到商品id',
  `goods_alias` varchar(200) DEFAULT '' COMMENT '与商品销售属性的名字',
  `sku_json` varchar(500) DEFAULT '' COMMENT '该商品的销售属性json',
  `shop_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '零售价格(打折后的价格)',
  `market_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '单位价格，单价，原价',
  `goods_number` int(11) NOT NULL DEFAULT '0' COMMENT '对应的商品数量',
  `last_buy_price` decimal(10,2) DEFAULT '0.00' COMMENT '最近采购价格',
  `is_del` tinyint(4) DEFAULT '1' COMMENT '是否删除,0表示删除,1表示未删除',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `unique_goods_id_sku_type` (`goods_id`,`sku_json`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8 COMMENT='商品销售的属性';

-- ----------------------------
--  Records of `an_jia_goods_sku`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_goods_sku` VALUES ('5', '9', '苹果手机1', '{\"颜色\":\"红色\"}', '1.00', '1.00', '0', '1.00', '1', '2020-04-02 14:08:33', '2020-04-04 13:32:51'), ('6', '9', '苹果手机2', '{\"颜色\":\"黄色\"}', '1.00', '1.00', '0', '1.00', '1', '2020-04-02 14:08:33', '2020-04-04 13:32:55');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_goods_sku_type`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_goods_sku_type`;
CREATE TABLE `an_jia_goods_sku_type` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `type` varchar(60) NOT NULL COMMENT '类型',
  `skus_json` varchar(500) NOT NULL DEFAULT '' COMMENT '存放商品销售属性的json字符串',
  `is_del` tinyint(4) DEFAULT '1' COMMENT '是否删除,0表示删除,1表示未删除',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `type` (`type`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='商品销售属性类型';

-- ----------------------------
--  Table structure for `an_jia_order`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_order`;
CREATE TABLE `an_jia_order` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `order_sn` varchar(30) NOT NULL DEFAULT '' COMMENT '订单号',
  `trade_no` varchar(100) DEFAULT '' COMMENT '支付交易号',
  `pay_method` tinyint(4) DEFAULT NULL COMMENT '支付方式:0是微信,1是支付宝',
  `user_id` mediumint(8) NOT NULL DEFAULT '0' COMMENT '用户id',
  `address_id` int(11) NOT NULL DEFAULT '0' COMMENT '收货地址id',
  `carriage` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '运费',
  `discount_carriage` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '优惠运费',
  `discount_amount` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '优惠金额',
  `discount_remark` varchar(500) DEFAULT NULL COMMENT '优惠说明',
  `actually_paid` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '最后实际付款金额',
  `status` tinyint(4) DEFAULT '0' COMMENT '状态:0.未付款,1.已付款,2.等待发货,3.已发货,4.已收款,5.退货, 6.等待商家同意退货,7.取消订单',
  `remark` varchar(200) DEFAULT '' COMMENT '备注信息',
  `cancel_order_reason` varchar(200) DEFAULT NULL COMMENT '取消订单原因',
  `sales_return_reaso` varchar(200) DEFAULT NULL COMMENT '申请退货原因',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='商品订单表';

-- ----------------------------
--  Records of `an_jia_order`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_order` VALUES ('4', '1586077879232267', '123456', null, '1', '1', '0.00', '0.00', '0.00', '', '30.00', '3', '微辣', null, null, '2020-04-05 17:11:19', '2020-04-05 21:23:57'), ('5', '1586079516368166', '123456', null, '1', '1', '0.00', '0.00', '0.00', '', '30.00', '2', '微辣', null, null, '2020-04-05 17:38:36', '2020-04-05 17:38:53');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_order_list`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_order_list`;
CREATE TABLE `an_jia_order_list` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `goods_id` int(11) NOT NULL COMMENT '商品id',
  `number` smallint(5) NOT NULL DEFAULT '1' COMMENT '订单数量',
  `market_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '市场价格',
  `shop_price` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '销售价格',
  `actually_paid` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '实际付款金额',
  `sku_json` varchar(500) DEFAULT '' COMMENT '该商品的销售属性json',
  `remark` varchar(200) DEFAULT '' COMMENT '备注信息',
  `order_id` int(11) NOT NULL COMMENT '关联到订单表',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='商品订单列表';

-- ----------------------------
--  Records of `an_jia_order_list`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_order_list` VALUES ('1', '2', '1', '30.00', '30.00', '30.00', '', '', '4', '2020-04-05 17:11:19', '2020-04-05 17:11:19'), ('2', '2', '1', '30.00', '30.00', '30.00', '', '', '5', '2020-04-05 17:38:36', '2020-04-05 17:38:36');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_role`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_role`;
CREATE TABLE `an_jia_role` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `uuid` varchar(50) NOT NULL COMMENT 'uuid主键',
  `title` varchar(50) NOT NULL COMMENT '角色',
  `description` varchar(100) DEFAULT NULL COMMENT '角色描素',
  `status` tinyint(4) DEFAULT '1' COMMENT '状态',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `title` (`title`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='角色表';

-- ----------------------------
--  Records of `an_jia_role`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_role` VALUES ('1', 'db9f275a-7b00-414d-9f3d-9a72727439f8', '超级管理员', null, '1', '2020-02-15 16:58:26', '2020-02-15 16:58:26'), ('2', '45cea322-a93f-470e-86e9-0458d2a852b0', '管理员', null, '1', '2020-02-15 16:58:33', '2020-02-15 16:58:33');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_role_access`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_role_access`;
CREATE TABLE `an_jia_role_access` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `role_id` int(11) DEFAULT NULL COMMENT '关联角色id',
  `access_id` int(11) DEFAULT NULL COMMENT '关联资源id',
  `type` varchar(10) DEFAULT NULL COMMENT '权限类型:1.表示菜单,2.表示接口',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='角色与资源中间表';

-- ----------------------------
--  Table structure for `an_jia_sales_return_reason`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_sales_return_reason`;
CREATE TABLE `an_jia_sales_return_reason` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `reason` varchar(200) DEFAULT '' COMMENT '申请退货原因',
  `is_del` tinyint(4) DEFAULT '1' COMMENT '是否删除,0表示删除,1表示未删除',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='已经支付申请退款原因';

-- ----------------------------
--  Table structure for `an_jia_site`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_site`;
CREATE TABLE `an_jia_site` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `name` varchar(50) NOT NULL COMMENT '站点名称',
  `description` varchar(100) DEFAULT '' COMMENT '描素',
  `address` varchar(200) DEFAULT '' COMMENT '站点地址',
  `status` tinyint(4) DEFAULT '1' COMMENT '状态0表示不可用，1表示可用',
  `print_sn` varchar(11) DEFAULT '' COMMENT '打印机编号',
  `is_del` tinyint(4) DEFAULT '1' COMMENT '是否删除,0表示删除，1表示没删除',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `name` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='站点或者叫仓库';

-- ----------------------------
--  Records of `an_jia_site`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_site` VALUES ('1', '站点一', '', '', '1', '960503661', '1', '2020-04-05 16:59:50', '2020-04-05 16:59:50');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_site_goods`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_site_goods`;
CREATE TABLE `an_jia_site_goods` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `site_id` int(11) NOT NULL DEFAULT '0' COMMENT '关联到站点的id',
  `goods_id` int(11) NOT NULL DEFAULT '0' COMMENT '关联到商品表的id',
  `goods_sku_id` int(11) NOT NULL DEFAULT '0' COMMENT '关联到商品sku表的id',
  `goods_number` int(11) NOT NULL DEFAULT '0' COMMENT '商品库存数量',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='商品库存表';

-- ----------------------------
--  Records of `an_jia_site_goods`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_site_goods` VALUES ('1', '1', '9', '5', '5', '2020-04-05 17:06:23', '2020-04-05 17:06:23'), ('2', '1', '9', '6', '5', '2020-04-05 17:06:23', '2020-04-05 17:06:23'), ('3', '1', '2', '0', '7', '2020-04-05 17:08:22', '2020-04-05 21:56:23');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_sms`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_sms`;
CREATE TABLE `an_jia_sms` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `mobile` varchar(11) DEFAULT NULL COMMENT '用户手机号码',
  `code` varchar(11) DEFAULT NULL COMMENT '验证码',
  `type` varchar(50) DEFAULT NULL COMMENT '发送短信的类型',
  `send_count` int(11) DEFAULT '0' COMMENT '当天发送短信的条数',
  `device_id` varchar(100) DEFAULT NULL COMMENT '针对移动端设备id',
  `send_day` varchar(10) DEFAULT NULL COMMENT '发送短信的时间:年月日',
  `send_time` varchar(20) DEFAULT NULL COMMENT '发送短信的时间鹾',
  `last_login_ip` varchar(60) DEFAULT '' COMMENT '发送信息的ip',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `mobile_time_type` (`mobile`,`type`,`send_time`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='发送短信';

-- ----------------------------
--  Records of `an_jia_sms`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_sms` VALUES ('1', '18170601666', '8888', 'register', '1', '123', '20200316', '1584346247155', '::1', '2020-03-16 15:45:38', '2020-03-16 16:10:47');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_store_bill`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_store_bill`;
CREATE TABLE `an_jia_store_bill` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `transaction_no` varchar(30) DEFAULT '' COMMENT '交易号',
  `supplier_id` int(11) DEFAULT '0' COMMENT '供货商id,只有采购入库的时候才有值',
  `is_del` tinyint(4) NOT NULL DEFAULT '1' COMMENT '是否作废0表示删除,1表示当前可用',
  `type` tinyint(4) NOT NULL DEFAULT '0' COMMENT '单据类型:0表示采购入库,1表示仓库之间的调拨单,2表示出库单,3表示盘点单',
  `bill_amount` decimal(10,2) DEFAULT '0.00' COMMENT '账单总金额',
  `from_store_id` int(11) NOT NULL DEFAULT '0' COMMENT '出库仓库id',
  `to_store_id` int(11) NOT NULL DEFAULT '0' COMMENT '入库仓库id',
  `description` varchar(200) DEFAULT '' COMMENT '描素',
  `operation` int(11) DEFAULT '0' COMMENT '操作员',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='进出仓库账单';

-- ----------------------------
--  Records of `an_jia_store_bill`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_store_bill` VALUES ('1', '1586077583249425', '1', '1', '0', '10.00', '0', '1', '简单入库2', '1', '2020-04-05 17:06:23', '2020-04-05 17:06:23'), ('2', '158607770225096', '1', '1', '0', '1.00', '0', '3', '简单入库1', '1', '2020-04-05 17:08:22', '2020-04-05 17:08:22');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_store_bill_goods`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_store_bill_goods`;
CREATE TABLE `an_jia_store_bill_goods` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `goods_id` int(11) NOT NULL DEFAULT '0' COMMENT '关联商品表id',
  `goods_sku_id` int(11) DEFAULT '0' COMMENT '关联goods_sku表的id',
  `goods_number` int(11) NOT NULL DEFAULT '0' COMMENT '商品数量',
  `last_buy_price` decimal(10,2) DEFAULT '0.00' COMMENT '最近采购价格',
  `goods_amount` decimal(10,2) DEFAULT '0.00' COMMENT '单品总价',
  `store_bill_id` int(11) DEFAULT '0' COMMENT '关联仓库账单的id',
  `description` varchar(200) DEFAULT '' COMMENT '描素',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8 COMMENT='进出仓库账单商品';

-- ----------------------------
--  Records of `an_jia_store_bill_goods`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_store_bill_goods` VALUES ('1', '9', '5', '5', '1.00', '5.00', '1', '', '2020-04-05 17:06:23', '2020-04-05 17:06:23'), ('2', '9', '6', '5', '1.00', '5.00', '1', '', '2020-04-05 17:06:23', '2020-04-05 17:06:23'), ('3', '3', '0', '1', '1.00', '1.00', '2', '', '2020-04-05 17:08:22', '2020-04-05 17:08:22');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_supplier`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_supplier`;
CREATE TABLE `an_jia_supplier` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `name` varchar(50) NOT NULL DEFAULT '' COMMENT '供货商名称',
  `company` varchar(100) DEFAULT '' COMMENT '所在公司',
  `mobile` varchar(11) NOT NULL DEFAULT '' COMMENT '手机号码',
  `accounts_payable` decimal(10,2) NOT NULL DEFAULT '0.00' COMMENT '应付账款',
  `is_del` tinyint(4) NOT NULL DEFAULT '1' COMMENT '是否删除0表示删除,1表示当前可用',
  `description` varchar(200) DEFAULT '' COMMENT '描素',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='供货商';

-- ----------------------------
--  Table structure for `an_jia_user`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_user`;
CREATE TABLE `an_jia_user` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `uuid` varchar(50) NOT NULL COMMENT 'uuid主键',
  `username` varchar(50) DEFAULT '' COMMENT '用户名',
  `password` varchar(100) NOT NULL COMMENT '用户密码',
  `mobile` varchar(50) DEFAULT '' COMMENT '用户手机号码',
  `email` varchar(50) DEFAULT '' COMMENT '用户邮箱',
  `avatar` varchar(255) DEFAULT '' COMMENT '头像地址',
  `status` tinyint(4) DEFAULT '1' COMMENT '用户状态',
  `platform` varchar(50) DEFAULT NULL COMMENT '平台',
  `is_super` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否为超级管理员',
  `site_id` int(11) DEFAULT '0' COMMENT '关联站点id',
  `last_login_ip` varchar(60) DEFAULT '' COMMENT '最后登录ip',
  `last_login_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '最后登录时间',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`),
  UNIQUE KEY `username` (`username`),
  UNIQUE KEY `mobile` (`mobile`),
  UNIQUE KEY `email` (`email`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COMMENT='用户表';

-- ----------------------------
--  Records of `an_jia_user`
-- ----------------------------
BEGIN;
INSERT INTO `an_jia_user` VALUES ('1', '90c7245e-6229-46dd-91f3-05b3f6c2ed52', 'admin', 'MU56S2NGcWk2Vg==ZTM5YTkzZjgwN2MzNjhkOTQzMWRlNzcxZThjMTgyMGI=', '90c7245e-6229-46dd-91f3-05b3f6c2ed52', '90c7245e-6229-46dd-91f3-05b3f6c2ed52', '', '1', null, '1', '1', '::1', '2020-04-01 16:32:01', '2020-02-22 15:37:42', '2020-04-05 17:04:38'), ('7', '16e834b7-b35a-4d3e-a243-a0026f09b4e6', '王五2', 'NzlhY2VpY2czdA==ZmFkYjY3ZDFkZmU5OGJkOThiMTJkMGFjZTk3ZTgyZWM=', '79b1a008-eb09-4a63-b5c7-fc98a0e5ff8b', '221@qq.com', '', '1', null, '0', '1', '', '2020-03-16 10:29:44', '2020-03-16 10:29:44', '2020-04-05 09:09:02'), ('8', '708b0f71-cc40-486a-ac90-29b9324f3526', '王五1', 'dnEzNlJEQVJWbg==NWUyYTkxYzI0YWJiYWExMzk1ODdiOTA0M2E0MjIzYjY=', '7dde0ab6-e192-42a1-a3de-54e7bd871280', '222@qq.com', '', '1', null, '0', '1', '', '2020-03-16 10:29:54', '2020-03-16 10:29:54', '2020-04-05 18:46:11');
COMMIT;

-- ----------------------------
--  Table structure for `an_jia_user_role`
-- ----------------------------
DROP TABLE IF EXISTS `an_jia_user_role`;
CREATE TABLE `an_jia_user_role` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `user_id` int(11) NOT NULL COMMENT '用户id',
  `role_id` int(11) NOT NULL COMMENT '角色id',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='用户角色表';

-- ----------------------------
--  Table structure for `an_jian_goods_images`
-- ----------------------------
DROP TABLE IF EXISTS `an_jian_goods_images`;
CREATE TABLE `an_jian_goods_images` (
  `id` int(11) NOT NULL AUTO_INCREMENT COMMENT '主键id',
  `goods_id` int(11) NOT NULL DEFAULT '0' COMMENT '商品id',
  `img_url` varchar(255) NOT NULL COMMENT '图片地址',
  `img_desc` varchar(255) DEFAULT NULL COMMENT '图片文字描述',
  `type` varchar(50) DEFAULT NULL COMMENT '图片类型',
  `sort` int(11) NOT NULL DEFAULT '5' COMMENT '排序',
  `status` tinyint(4) DEFAULT '1' COMMENT '状态',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 COMMENT='商品图片';

SET FOREIGN_KEY_CHECKS = 1;
